<template>
    <div>
        <input type="text" v-model="val">
        <el-button type="primary" @click="ToLogin" >普通用户登录</el-button>
        <el-button type="primary" @click="ToLogin1" >管理员登录</el-button>
    </div>
</template>

<script setup lang="ts">
import { router } from '@/router';
import { useRoute } from "vue-router"
import {ref} from 'vue'
const routes =useRoute()
const val = ref('')
console.log(routes);

const ToLogin = ()=>{
    localStorage.setItem('token','普通用户')
    router.push('/home')
}
const ToLogin1 = ()=>{
    localStorage.setItem('token','admin')
    router.push('/home')
}
</script>

<style scoped>

</style>